const types = {
    type: 'AABB',
    icon: 'icon-widget-phone-dialer',
    title: 'widgetName',
    platforms: ['web', 'android'],
    isGlobalWidget: !0,
    isInvisibleWidget: !0,
    properties: [
        {
            key: 'phoneNumber',
            label: 'phoneNumber',
            valueType: 'string',
            checkType: ['string', 'number'],
            defaultValue: '',
            validators: {
                notEmpty: { value: !0, message: 'phoneNumberNotEmpty' },
            },
        },
        {
            key: 'ButtonTextGroup',
            label: 'ButtonTextGroup',
            valueType: 'string',
            editorType: 'ButtonTextGroup',
            defaultValue: '',
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'ButtonIconGroup',
            label: 'ButtonIconGroup',
            valueType: 'string',
            editorType: 'ButtonIconGroup',
            defaultValue: '',
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'ButtonBackground',
            label: 'ButtonBackground',
            valueType: 'string',
            editorType: 'ButtonBackground',
            defaultValue: '',
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'textVisible',
            label: 'text',
            valueType: 'boolean',
            defaultValue: !0,
            hidePropertyEditor: !0,
            dropdown: [
                { label: 'show', value: !0 },
                { label: 'hide', value: !1 },
            ],
            blockOptions: {
                getter: { generateBlock: !1 },
                setter: { line: 'text' },
            },
        },
        {
            key: 'text',
            label: 'textContent',
            valueType: 'string',
            checkType: ['string', 'number', 'boolean', 'array'],
            defaultValue: '\u6309\u94ae',
            hidePropertyEditor: !0,
            blockOptions: { getter: { line: 'returnValue' } },
        },
        {
            key: 'textColor',
            label: 'textColor',
            valueType: 'color',
            defaultValue: ke.e,
            hidePropertyEditor: !0,
        },
        {
            key: 'maxFontSize',
            label: 'maxFontSize',
            valueType: 'number',
            defaultValue: ke.h,
            hidePropertyEditor: !0,
            blockOptions: { getter: { generateBlock: !1 } },
            validators: {
                greaterThan: { value: ke.o, message: 'outOfRange' },
                lessThan: { value: ke.l, message: 'outOfRange' },
                isInteger: !0,
            },
        },
        {
            key: 'textAlign',
            label: 'textAlign',
            valueType: 'string',
            defaultValue: Ie.a.CENTER,
            hidePropertyEditor: !0,
            dropdown: [
                { label: 'left', value: Ie.a.LEFT },
                { label: 'center', value: Ie.a.CENTER },
                { label: 'right', value: Ie.a.RIGHT },
            ],
            blockOptions: { getter: { generateBlock: !1 } },
        },
        {
            key: 'iconVisible',
            label: 'icon',
            valueType: 'boolean',
            defaultValue: !1,
            hidePropertyEditor: !0,
            dropdown: [
                { label: 'show', value: !0 },
                { label: 'hide', value: !1 },
            ],
            blockOptions: {
                getter: { generateBlock: !1 },
                setter: { line: 'icon' },
            },
        },
        {
            key: 'iconId',
            label: 'iconId',
            valueType: 'icon',
            defaultValue: '',
            hidePropertyEditor: !0,
            blockOptions: { getter: { generateBlock: !1 } },
        },
        {
            key: 'iconColor',
            label: 'iconColor',
            valueType: 'color',
            defaultValue: ke.d,
            hidePropertyEditor: !0,
            blockOptions: { getter: { generateBlock: !1 } },
        },
        {
            key: 'fontFamily',
            label: 'fontFamily',
            valueType: 'string',
            defaultValue: ke.b,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'allowMinFontSize',
            label: 'allowMinFontSize',
            valueType: 'number',
            defaultValue: ke.o,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'allowMaxFontSize',
            label: 'allowMaxFontSize',
            valueType: 'number',
            defaultValue: ke.l,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'backgroundMode',
            label: 'backgroundMode',
            valueType: 'string',
            defaultValue: we.a.TEMPLATE,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'templateMode',
            label: 'templateMode',
            valueType: 'string',
            defaultValue: we.b.RECTANGLE_FILL,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'backgroundColor',
            label: 'backgroundColor',
            valueType: 'color',
            defaultValue: ke.a,
            hidePropertyEditor: !0,
            blockOptions: {
                setter: { generateBlock: !1 },
                getter: { generateBlock: !0 },
            },
        },
        {
            key: 'backgroundImage',
            label: 'backgroundImage',
            valueType: 'string',
            defaultValue: ke.f,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
        {
            key: 'imageResizeMode',
            label: 'imageResizeMode',
            valueType: 'string',
            defaultValue: we.c.CONTAIN,
            hidePropertyEditor: !0,
            blockOptions: { generateBlock: !1 },
        },
    ],
    methods: [
        {
            key: 'callNumber',
            label: 'callNumber',
            params: [],
            tooltip: 'callNumberTooltip',
        },
        {
            key: 'dialNumber',
            label: 'dialNumber',
            params: [],
            tooltip: 'dialNumberTooltip',
        },
    ],
    events: [
        {
            key: 'onReceivePhoneCall',
            label: 'onReceivePhoneCall',
            params: [],
            blockOptions: { icon: '%{BKY_BLOCK_PHONE_ICON}' },
        },
        {
            key: 'onConnectReceivePhoneCall',
            label: 'onConnectReceivePhoneCall',
            params: [],
            blockOptions: { icon: '%{BKY_BLOCK_PHONE_ICON}' },
        },
        {
            key: 'onPhoneCallStart',
            label: 'onPhoneCallStart',
            params: [],
            blockOptions: { icon: '%{BKY_BLOCK_PHONE_ICON}' },
        },
        {
            key: 'onPhoneCallEnd',
            label: 'onPhoneCallEnd',
            params: [{ key: 'state', label: 'state', valueType: 'number' }],
            tooltip: 'onPhoneCallEndTooltip',
            blockOptions: { icon: '%{BKY_BLOCK_PHONE_ICON}' },
        },
    ],
};

class XJWidget extends InvisibleWidget {
    constructor(p) {
        super(p);
        Object.assign(this, p);
    }
}

for (let i of types.methods) i.blockOptions = { ...i.blockOptions, callMethodLabel: false };

exports.types = types;
exports.widget = XJWidget;
